package bootstrap.liftweb

import net.liftweb.util._
import net.liftweb.http._
import net.liftweb.sitemap._
import net.liftweb.sitemap.Loc._
import Helpers._
 
/**
  * A class that's instantiated early and run.  It allows the application
  * to modify lift's environment
  */
class Boot {
  def boot {    
    LiftRules.addToPackages("cl.fbd.widget_examples.web")     

    // Build SiteMap
    val entries = Menu(Loc("Home", "/", "Home")) ::
                  Menu(Loc("Flot: Basic", "/basic", "Flot: Basic example")) ::
                  Menu(Loc("Flot: Graph-Types", "/graph-types", "Flot: Different graph types")) ::
                  Menu(Loc("Flot: Setting-Option", "/setting-option", "Flot: Setting various options")) ::
                  Menu(Loc("Flot: Selection", "/selection", "Flot: Selection and zooming")) ::
                  Menu(Loc("Flot: Zooming", "/zooming", "Flot: Zooming with overview")) ::
                  Menu(Loc("Flot: Time", "/time", "Flot: Plotting times series")) ::
                  Menu(Loc("Flot: Visitors", "/visitors", "Flot: Visitors per day")) ::
                  Menu(Loc("Flot: Interacting", "/interacting", "Flot: Interacting with the data")) ::
                  Menu(Loc("treetable: alone", "/treetable-alone", "Treetable: alone")) ::
                  Menu(Loc("treetable+flot+ajax", "/treetable-flot-ajax", "Treetable+Flot+AJAX")) ::
                  Menu(Loc("flot+comet", "/flot-comet", "Flot+Comet")) ::
                  Menu(Loc("treeview", "/tree-view", "TreeView")) ::
                  Nil
    LiftRules.setSiteMap(SiteMap(entries:_*))
    
    // register treetable resources (javascript and gifs) 
    net.liftweb.widgets.flot.Flot.init ()
    
    // register tree-table and tree-view resources (javascript) 
    net.liftweb.widgets.trees.treetable.TreeTable.init ()
    net.liftweb.widgets.trees.treeview.TreeView.init ()
    
    // 
    cl.fbd.widget_examples.web.model.Sensor.start
  }
}



